<?php

declare (strict_types = 1);

namespace app\adminapi\validate;

use think\Validate;

class UserLevelValidate extends Validate
{
    protected $rule = [
      'level'  => 'require|number|unique:user_level,level',
    ];

    protected $message  =   [
        'level.require' => '请填写用户等级',
        'level.number' => '用户等级只能是数字',
        'level.unique' => '该用户等级已存在',
    ];
  
    protected $scene = [
      'add'    =>  ['level'],
      'edit'    =>  ['level'],
    ];    
}